//
//  YXUserdefaults.m
//  YiXiProject
//
//  Created by iMac on 2019/7/30.
//  Copyright © 2019 iMac. All rights reserved.
//

#import "YXUserdefaults.h"

@implementation YXUserdefaults

+ (instancetype)standardUserDefaults
{
    static dispatch_once_t pred;
    static YXUserdefaults *sharedInstance = nil;
    dispatch_once(&pred, ^{ sharedInstance = [[self alloc] init]; });
    return sharedInstance;
}


+(void)PutDefaults:(NSString *)key Value:(id)value
{
    if (key!=NULL&&value!=NULL)
    {
        NSUserDefaults *userDefaults=[NSUserDefaults standardUserDefaults];
        [userDefaults setObject:value forKey:key];
    }
}

+(id)GetDefaults:(NSString *)key
{
    NSUserDefaults *userDefaults=[NSUserDefaults standardUserDefaults];
    id obj;
    if (key!=NULL)
    {
        obj=[userDefaults objectForKey:key];
    }
    return obj;
}


@end
